<?php
class pc_check_login extends common
{
    function index()
    {
        $arr = array();
        $user_info = array();

        $user_id = $this->cas_check_login('pc');
        if ($user_id > 0) {
            $mysql_db = _mysqllogon('Mysql_102');
            $sql_t = "select id, parent_id, user_pwd, user_name, real_name from spread_user where id = :id";
            $stmt_t = _mysqlparse($mysql_db, $sql_t);
            _mysqlbindbyname($stmt_t, ":id", $user_id);
            $mysql_error_t = _mysqlexecute($stmt_t);
            $user_info = mysql_fetch_assoc($stmt_t);

            $user_name = empty($user_info['user_name']) ? $user_info['id'] : $user_info['user_name'];
            $arr = array(
                'user_id' => $user_info['id'],
                'user_name' => $user_name,
                'is_login' => 1,
                'session_id' => $_COOKIE['session_id'],
            );
            $arr['eval'] = "false";
        } else {
            $arr = array(
                'is_login' => 0,
                'eval' => "false",
            );
        }
        $this->_jsonpreturn(json_encode($arr));
    }
}

?>